CloneContents Method

Wintellect PowerCollections

Collapse imageExpand ImageCollapseAll imageExpandAll imageDropDown imageDropDownHover imageCopy imageCopyHover image
[This topic is pre-release documentation and is subject to change in future releases. Blank topics are included as placeholders.]

Makes a deep clone of this dictionary. A new dictionary is created with a clone of each entry of this dictionary, by calling ICloneable.Clone on each element. If TKey or TValue is a value type, then each element is copied as if by simple assignment.

Namespace: Wintellect.PowerCollections
Assembly:  PowerCollections (in PowerCollections.dll)

Syntax

C#
public OrderedDictionary<TKey, TValue> CloneContents()
Visual Basic (Declaration)
Public Function CloneContents As OrderedDictionary(Of TKey, TValue)
Visual C++
public:
OrderedDictionary<TKey, TValue>^ CloneContents ()

Return Value

The cloned dictionary.

Remarks

If TKey or TValue is a reference type, it must implement ICloneable. Otherwise, an InvalidOperationException is thrown.

Cloning the dictionary takes time O(N log N), where N is the number of keys in the dictionary.

Exceptions

ExceptionCondition
System..::InvalidOperationExceptionTKey or TValue is a reference type that does not implement ICloneable.

See Also